package ch.zbw.pra.sysventory.database.mapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import ch.zbw.pra.sysventory.model.Computer;

/**
 * Mapping von einem Resultset auf ein Computer Objekt
 * 
 * @author Roberto Lucas
 */

public class ComputerMapper implements RowMapper<Computer>,Serializable {

	private static final long serialVersionUID = -785160099613188193L;

	public Computer mapRow(ResultSet rs, int rowNum) throws SQLException {
		Computer computer = new Computer();
		computer.setId(rs.getInt("compID_pk"));
		computer.setHostNameComputer(rs.getString("compName"));
		computer.setRamComputer(rs.getString("compRAM"));
		computer.setTypeComputer(rs.getString("compTyp"));
		computer.setSidComputer(rs.getString("compSid"));
		
		return computer;
	}

}
